package net.lijingye.education.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * Created by LijingYe on 2016/4/3.
 */
@Entity
@Table(name = "source")
public class Source implements Serializable {
    @Id
    @Column(name = "sourceId")
    private int id;
    @OneToOne
    @JoinColumn(name = "userId")
    private User user;
    @Column(name = "title")
    private String title;
    @Column(name = "filePath")
    private String filePath;
    @Column(name = "time")
    private Date time;
    @Column(name = "kickCount")
    private Integer kickTime;
    @Column(name = "downloadCount")
    private Integer downloadTime;
    @Column(name = "type")
    private Integer type;
    @Column(name = "description")
    private String description;
    @OneToOne
    @JoinColumn(name = "classId")
    private Lesson lesson;
    @OneToMany
    @JoinColumn(name = "sourceId")
    @OrderBy("time asc")
    private List<SourceReply> sourceReplyList;
    @OneToMany
    @JoinColumn(name = "sourceId")
    private List<SourceScore> sourceScoreList;

    public Source() {
    }

    public Source(int id, User user, String title, String filePath, Date time, Integer kickTime, Integer downloadTime, Integer type, String description, Lesson lesson, List<SourceReply> sourceReplyList, List<SourceScore> sourceScoreList) {
        this.id = id;
        this.user = user;
        this.title = title;
        this.filePath = filePath;
        this.time = time;
        this.kickTime = kickTime;
        this.downloadTime = downloadTime;
        this.type = type;
        this.description = description;
        this.lesson = lesson;
        this.sourceReplyList = sourceReplyList;
        this.sourceScoreList = sourceScoreList;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public Integer getKickTime() {
        return kickTime;
    }

    public void setKickTime(Integer kickTime) {
        this.kickTime = kickTime;
    }

    public Integer getDownloadTime() {
        return downloadTime;
    }

    public void setDownloadTime(Integer downloadTime) {
        this.downloadTime = downloadTime;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Lesson getLesson() {
        return lesson;
    }

    public void setLesson(Lesson lesson) {
        this.lesson = lesson;
    }

    public List<SourceReply> getSourceReplyList() {
        return sourceReplyList;
    }

    public void setSourceReplyList(List<SourceReply> sourceReplyList) {
        this.sourceReplyList = sourceReplyList;
    }

    public List<SourceScore> getSourceScoreList() {
        return sourceScoreList;
    }

    public void setSourceScoreList(List<SourceScore> sourceScoreList) {
        this.sourceScoreList = sourceScoreList;
    }


}
